package com.panopset.gui;

import java.awt.Color;
import java.awt.Font;

import javax.swing.JLabel;

import com.panopset.java.Version;

/**
 * Standard Panopset Swing label.
 *
 * @author Karl Dinwiddie
 *
 */
public class TLabel extends JLabel {

    /**
     * Default foreground color.
     */
    private static final Color DEFAULT_FGCOLOR = Color.BLACK;

    /**
     *
     * @param title
     *            Title
     */
    public TLabel(final String title) {
        setText(title);
        init();
    }

    /**
     *
     * @param title
     *            Title
     * @param labelFont
     *            Label font.
     */
    public TLabel(final String title, final Font labelFont) {
        this(title);
        setFont(labelFont);
    }

    /**
     *
     * @param title
     *            Title.
     * @param labelFont
     *            Label font.
     * @param textColor
     *            Text color.
     */
    public TLabel(final String title, final Font labelFont,
            final Color textColor) {
        this(title, labelFont);
        setForeground(textColor);
    }

    /**
     * Init.
     */
    private void init() {
        setBackground(LookAndFeel.Colors.BG_COLOR.getColor());
        FontManager.register(this, FontManager.FontType.boldArial);
        setForeground(DEFAULT_FGCOLOR);
    }

    /**
     * Serial version number.
     */
    private static final long serialVersionUID = Version.UNI_VERSION;
}
